"""
  Created by Amor on 2018-09-02
"""
from .error import APIException

__author__ = '骆杨'


class ParameterException(APIException):
    code = 400
    msg = 'invalid parameter'
    error_code = 1000


class Success(APIException):
    code = 201
    msg = 'success'
    error_code = 0


class DeleteSuccess(Success):
    code = 202
    error_code = -1


class NotFound(APIException):
    code = 404
    msg = 'the resource are not found o(TヘTo)'
    error_code = 1001


class AuthFailed(APIException):
    code = 401
    msg = 'authorization failed'
    error_code = 1005


class ServerError(APIException):
    pass


class Forbidden(APIException):
    code = 403
    msg = 'forbidden, not in scope'
    error_code = 1004


class DuplicateGift(APIException):
    code = 400
    error_code = 2001
    msg = 'the current book has already in gift'
